<?php
/**
 * Created by JetBrains PhpStorm.
 * User: akrug
 * Date: 25.05.12
 * Time: 12:25
 * To change this template use File | Settings | File Templates.
 */
class Backend_Model_DbTable_Buscompany extends UcsMvc_AbstractDbTable
{
    protected $_name    = 'bus_company';

    public function init(){
        $this->_setupPrimaryKey();//identifies primerykey
    }

    /**
     * entfernt interne metadaten vor der rueckgabe
     *
     * @return array - one defined Company
     */
    public function getCompanyTrimmed($id){
        $company = parent::getRow($id);

        if($company){
            if(isset($company['bus_company_hidden'])){
                unset($company['bus_company_hidden']);
            }

            if(isset($company['bus_company_deleted'])){
                unset($company['bus_company_deleted']);
            }

            if(isset($company['bus_company_created'])){
                unset($company['bus_company_created']);
            }

            return $company;
        }

        return false;
    }
}
